IF NOT EXISTS(SELECT [Name] FROM syscolumns WHERE Name = 'ProductPrice' AND ID = OBJECT_ID('dbo.BillDetail'))
   ALTER TABLE BillDetail ADD ProductPrice INT NOT NULL
   
IF NOT EXISTS(SELECT [Name] FROM syscolumns WHERE Name = 'RemainAmount' AND ID = OBJECT_ID('dbo.InOutProdDetail'))
   ALTER TABLE InOutProdDetail ADD RemainAmount INT NOT NULL
   
IF NOT EXISTS(SELECT [Name] FROM syscolumns WHERE Name = 'Barcode' AND ID = OBJECT_ID('dbo.Product'))
   ALTER TABLE Product ADD Barcode CHAR(13) NULL

ALTER TABLE BillDetail DROP FK_BillDetail_Barcode   
ALTER TABLE BillDetail DROP COLUMN BarcodeId

DROP TABLE Barcode